#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>

void *first_thread_func(void *arg)
{
    printf("Hello from first thrad %d\n",gettid());
}
void *scound_thread_func(void *arg)
{
    printf("Hello from scound thread  %d\n",gettid());
}

int main(int argc, char const *argv[])
{
    pthread_t th1, th2;
    pthread_create(&th1, NULL, first_thread_func, NULL);
    pthread_create(&th2, NULL, scound_thread_func, NULL);
    printf("主线程 %d\n ",gettid());
    printf("两个分线程 th1=%ld  th2=%ld\n",th1, th2);
    pthread_join(th1, NULL);
    pthread_join(th2, NULL);
    return 0;
}
